package com.comum.javahomework420242025.repository;

import com.comum.javahomework420242025.pojo.Tender;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

public interface TenderRepository extends JpaRepository<Tender,Long> {
    @Query("select t from tender t where " +
            "t.name like %:str% or t.type like %:str% or " +
            "cast(t.chanceid as string) like %:str% or " +
            "t.chance.clientCompany.clientcompanyname like %:str% or " +
            "t.chance.projectname like %:str% or " +
            "t.status like %:str%")
    Page<Tender> getTenders(String str, Pageable pageable);
}
